/* 
 * File:   pyframe.hpp
 * Author: gian
 *
 * Created on April 17, 2012, 11:39 AM
 */

#ifndef PYFRAME_HPP
#define	PYFRAME_HPP

#include "vector.hpp"

class missing_data_error: public std::runtime_error
{
  public:
  missing_data_error() : std::runtime_error("Missing data") {};
};


class missing_frame_error: public std::runtime_error
{
  public:
  missing_frame_error() : std::runtime_error("Missing frame") {};
};

/**
 * Get a vector of data from a frame file
 * @param filename the name of the file containing the frames
 * @param channel the name of the channel to read
 * @param gps the gps start time of the data
 * @param len the length of the data that must be read
 * @param out the vector to be used to store the data
 */
void getY(char *filename, char *channel, int gps, int len, vector *out);
/**
 * Get a vector of data from a frame file, with missing data management.
 * @param filename the name of the file containing the frames
 * @param channel the name of the channel to read
 * @param gps the gps start time of the data
 * @param len the length of the data that must be read
 * @param out the vector to be used to store the data
 * @param miss the vector to be used to store missind data information
 */
void getY_missing(char *filename, char *channel, int gps, int len, vector *out, vector *miss);
/**
 * Read channel informations from a frame file
 * @param filename the name of the file containing the frames
 * @param gps the gps start time
 * @return a string containing informations about available channels
 */
std::string getChannels(char *filename, int gps);


void getY_float(char *filename, char *channel, int gps, int len, vectorf *out);

void getY_missing_float(char *filename, char *channel, int gps, int len, vectorf *out, vectorf *miss);


#endif	/* PYFRAME_HPP */

